import { RouteProp } from '@react-navigation/native'
import React, { Component } from 'react'
import { View,Text } from 'react-native'
import { RootStackParamList } from '../navigator'

interface IProps {
  route: RouteProp<RootStackParamList, 'Detail'>
}
export default class Detail extends Component<IProps> {
  render() {
    const {route} = this.props
    return (
      <View>
        <Text>Detail</Text>
        {/* 获取动态路由传递的路由参数 */}
        <Text>{route.params.id}</Text>
      </View>
    )
  }
}
